import Vue from 'vue'
import App from './App.vue'
import router from './router'
//倒入全局样式表
import './assets/css/style-g.css'
//导入字体样式表
import './assets/fonts/iconfont.css'
//elementui
import './plugins/element.js'
//请求框架
import axios from 'axios'
import TreeTable from 'vue-table-with-tree-grid'
//进度条
import Nprogress from "nprogress"
import "nprogress/nprogress.css"
//请求拦截
axios.interceptors.request.use(config=> {
  Nprogress.start()
  config.headers.Authorization=window.sessionStorage.getItem("token");
  return config;
})
//响应拦截
axios.interceptors.response.use(config=> {
  Nprogress.done()
  return config;
})
Vue.prototype.$http = axios;
axios.defaults.baseURL = "http://127.0.0.1:8888/api/private/v1/"
Vue.config.productionTip = false
//引入富文本编辑器
// import VueQuillEditor from 'vue-quill-editor'
// // require styles
// import 'quill/dist/quill.core.css'
// import 'quill/dist/quill.snow.css'
// import 'quill/dist/quill.bubble.css'
Vue.use(VueQuillEditor)
//属性表格
Vue.component('tree-table', TreeTable)
//时间格式过滤器
Vue.filter("dateformat", function(value) {
  const dt=new Date(value);
  const y=dt.getFullYear();
  const m=(dt.getMonth()+1+"").padStart(2,"0");
  const d=(dt.getDate()+"").padStart(2,"0");
  const hh=(dt.getHours()+"").padStart(2,"0");
  const mm=(dt.getMinutes()+"").padStart(2,"0");
  const ss=(dt.getSeconds()+"").padStart(2,"0");
  return `${y}-${m}-${d} ${hh}:${mm}:${ss}`
})
new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
